<template>
	<view>
		<u-empty v-if="list.length==0"></u-empty>
		<view class="int_list" v-else>
			<view class="item u-border-bottom" v-for="item in list" :key='item.id' @click="handNavTo(item.userId)">
				<view class="right u-border-right">
					<image class="icon" :src="item.handlUrl" mode="">
					</image>
					<view class="content">
						{{item.nickName}}
					</view>
				</view>
				<view class="num">
					返利金额: {{item.rebateAmount||0.00}}
				</view>
			</view>
			<u-loadmore :status="status" />
		</view>
	</view>
</template>

<script>
	import initData from '@/mixin/initData.js'
	export default {
		mixins: [initData],
		data() {
			return {
				userInfo: {}
			};
		},
		onLoad() {
			const userInfo = this.cache.getCache('userInfo')
			this.userInfo = userInfo
			this.miXinInit()
		},
		methods: {
			handNavTo(userId) {
				if (!userId) return
				uni.navigateTo({
					url: '/pages/myInvitation/myInvitation2?userId=' + userId
				})
			},
			// 请求前的参数处理
			beforeInit() {
				this.apiUrl = "appUser/myInvitation";
				let params = {
					pageNum: this.pageNum,
					pageSize: this.pageSize,
					userId: this.userInfo.id
				};

				this.params = {
					...params
				};
			},
		}
	}
</script>

<style lang="scss" scoped>
	.int_list {
		padding: 0 30rpx;

		.item {
			padding: 24rpx 0;

			display: flex;
			align-items: center;
			justify-content: space-between;

			.right {
				display: flex;
				padding-right: 30rpx;
				margin-right: 30rpx;
				align-items: center;
			}

			.num {
				color: #FF0E3D;
				font-size: 32rpx;
				white-space: nowrap;
			}

			.content {
				font-size: 21rpx;
				color: #ACACAC;
			}

			.icon {
				width: 54rpx;
				height: 54rpx;
				min-width: 54rpx;
				min-height: 54rpx;
				margin-right: 20rpx;
				border-radius: 50%;
			}
		}
	}
</style>
